import React from 'react';
import s from './style.less';

const SearchReturnBox = ({data, handleItemClick})=>{

    return (
        <div className={s.searchResult}>
            <ul>
                {data && data.map((item,index)=>(
                    <li 
                    className={s.item} 
                    key={item.id || index} 
                    onClick={handleItemClick} 
                    value={(item.name && item.name +'  '+ item.artists[0].name) || item.first}>
                        {(item.name && item.name +'  '+ item.artists[0].name) || item.first}
                    </li>
                ))}
                
            </ul>
        </div>
    )
}

export default SearchReturnBox;